refactor: multi_agent/ package shims (pre-split prep)#51
Draft
Simon-Free wants to merge 5 commits intoSafeRL-Lab:mainfrom
Draft
refactor: multi_agent/ package shims (pre-split prep)#51Simon-Free wants to merge 5 commits intoSafeRL-Lab:mainfrom
Simon-Free wants to merge 5 commits intoSafeRL-Lab:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce a
multi_agent/package with shim modules (definitions.py,manager.py,task.py,tools.py,subagent.py) that re-export the relevant names from the 480-linemulti_agent/subagent.pymonolith. Also add a root-levelsubagent.pyproxy for back-compat with callers that importfrom subagent import ....What this PR is - and is not
Is: a non-breaking preparation step. Callers can now import via the new paths (
from multi_agent.manager import SubAgentManager,from multi_agent.task import SubAgentTask, etc.) without any change to runtime behaviour.Is not: the actual split.
multi_agent/subagent.pyis still 480 lines; code was not moved out of it. The follow-up PR will physically moveAgentDefinition/SubAgentManager/SubAgentTaskimplementations into their respective modules, at which point the re-export shims become real modules and the old file becomes a thin re-exporter or gets deleted. Splitting in two steps keeps the first PR trivial to review and lets new callers migrate to the new import paths before the move.Changes
multi_agent/__init__.pymulti_agent/definitions.pyAgentDefinition,get_agent_definition,load_agent_definitionsfromsubagentmulti_agent/manager.pySubAgentManagermulti_agent/task.pySubAgentTask+ helpersmulti_agent/tools.pyAgenttool registration point (preserved)multi_agent/subagent.pysubagent.py(root)from subagent import .keeps workingtests/test_multi_agent_split.pytests/test_subagent.pyWhy no e2e test in this PR
There is no new behaviour to exercise - only module re-exports. Any real e2e (subagent spawn / task life-cycle / transcript capture) stays valid whichever import path the caller uses, so it belongs with the physical split in the follow-up PR. The
test_multi_agent_splitmodule asserts identity (AD is AgentDefinition), which is the strongest guarantee possible for a shim layer.Ref #43